// router/router.js
export const routes = [
  {
    // 首页
    path: '/login',
    name: 'Login',
    component: () =>
      import(/* webpackChunkName: "about" */ '../views/Login.vue')
  },
  {
    // 主页面 当进入主页面路由自动进入首页
    path: '/main',
    name: 'Main',
    redirect: 'shouye',
    component: () =>
      import(/* webpackChunkName: "about" */ '../views/Main.vue'),
    children: [
      {
        // 首页
        path: 'shouye',
        name: 'Shouye',
        component: () =>
          import(/* webpackChunkName: "about" */ '../views/classfly/Shouye.vue')
      },
      {
        // 购物车
        path: 'shop',
        name: 'Shop',
        component: () =>
          import(/* webpackChunkName: "about" */ '../views/classfly/Shop.vue')
      },
      {
        // 个人中心
        path: 'my',
        name: 'My',
        component: () =>
          import(/* webpackChunkName: "about" */ '../views/classfly/My.vue')
      },
      {
        // 菜单栏
        path: 'caidan',
        name: 'Caidan',
        component: () =>
          import(/* webpackChunkName: "about" */ '../views/classfly/CaiDan.vue')
      },
      {
        // 订单栏
        path: 'dingdan',
        name: 'Dingdan',
        component: () =>
          import(
            /* webpackChunkName: "about" */ '../views/classfly/Dingdan.vue'
          )
      }
    ]
  },
  {
    // 商品详情
    path: '/detail',
    name: 'Detail',
    component: () =>
      import(/* webpackChunkName: "about" */ '../views/Detail.vue')
  },
  {
    // 订单提交页面
    path: '/tijiao',
    name: 'Tijiao',
    component: () =>
      import(/* webpackChunkName: "about" */ '../views/Tijiao.vue')
  },
  {
    // 收藏夹
    path: '/collect',
    name: 'Collect',
    component: () =>
      import(/* webpackChunkName: "about" */ '../views/Collect.vue')
  },
  {
    // 地址设置页面
    path: '/site',
    name: 'Site',
    component: () => import(/* webpackChunkName: "about" */ '../views/Site.vue')
  },
  {
    // 个人资料页面
    path: '/personal',
    name: 'Personal',
    component: () =>
      import(/* webpackChunkName: "about" */ '../views/Personal.vue')
  },
  {
    // 安全中心
    path: '/safety',
    name: 'Safety',
    component: () =>
      import(/* webpackChunkName: "about" */ '../views/Safety.vue')
  },
  {
    // 设置密码页面
    path: '/setpasswo',
    name: 'setpasswo',
    component: () =>
      import(/* webpackChunkName: "about" */ '../views/setpasswo.vue')
  },
  {
    // 找回密码页面
    path: '/forgetpassword',
    name: 'Forgetpassword',
    component: () =>
      import(/* webpackChunkName: "about" */ '../views/Forgetpassword.vue')
  },
  {
    // 订单详情页面
    path: '/orderdetails',
    name: 'orderdetails',
    component: () =>
      import(/* webpackChunkName: "about" */ '../views/orderdetails.vue')
  },
  {
    // 当用户访问不存在的路径时自动回到首页
    path: '*',
    redirect: {
      name: 'Shouye'
    }
  }
]
